/******************************************************************************
* File description: ExperimentThread.h
* Function: 实验相关公共方法
* Current Version: 1.0.0
* Author: 郑佰旺
* Date: 2025-07-1
*  -----
*  Copyright by 博坤生物 .
 *****************************************************************************/

#ifndef EXPERIMENTTHREAD_H
#define EXPERIMENTTHREAD_H

#include <QObject>
#include <Connect/UdpClient.h>
#include <QTimer>
#include <StaticProperties.h>

class ExperimentThread : public QObject
{
    Q_OBJECT;
private:
    ExperimentThread();

public:
    static ExperimentThread& I();

public:
    void run();
    void concurrencyUnionRun();
    void setExpInfo();

private:
    void refPurifyingExpLog(int step,QString type,int msecs=0);
    QString routineVerification();
    bool specialStepVerification();
    void specialStepExecute();
    void checkWaitStepStatus();
    void stepProcessing(QVariantMap);

private:
    int initialUnionStep;
    bool isUnion;
    int unionTime;
    qint64 msecs;
    bool isCircle;
    int circleTime;
    QDateTime concurrencyStartTime;
    int totalconcurrencyMsecs;
    qint64 conMsecs;
    int waitStep;
    QTimer *stepWaitTimer;
};
#endif // EXPERIMENTTHREAD_H
